/* Basic Styling */
:root {
    --primary-color: #007bff;
    --border-color: #ddd;
    --background-color: #f8f9fa;
    --text-color: #333;
    --hover-bg-color: #e9ecef;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.main-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

.sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.sidebar h2, .content h2 {
    margin-top: 0;
}

#bucket-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#bucket-list li {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}

#bucket-list li:hover {
    background-color: var(--hover-bg-color);
}

#bucket-list li.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

#bucket-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bucket-name {
    flex: 1;
    font-weight: 500;
}

.bucket-file-count {
    font-size: 0.85em;
    opacity: 0.8;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

#bucket-list li.active .bucket-file-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 表格列宽设置 */
#file-table th:nth-child(3) {
    min-width: 240px; /* 文件大小列宽度 - 2倍宽度 */
    white-space: nowrap;
}

#file-table th:nth-child(4) {
    min-width: 180px; /* 增加时间列宽度 */
    white-space: nowrap;
}

#file-table th:nth-child(5) {
    min-width: 180px; /* 增加操作列宽度 */
    white-space: nowrap;
}

/* 操作按钮样式 */
.copy-link-btn, .preview-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    margin-right: 5px;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.copy-link-btn:hover {
    background-color: #e3f2fd;
}

.preview-btn:hover {
    background-color: #f3e5f5;
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background-color: #4caf50;
}

.message.error {
    background-color: #f44336;
}

.message.info {
    background-color: #2196f3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 图片预览模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    word-break: break-all;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

#bucket-list li:hover .bucket-file-count {
    background-color: rgba(0, 0, 0, 0.15);
}

.table-container {
    overflow-x: auto;
}

#file-table {
    width: 100%;
    border-collapse: collapse;
}

#file-table th, #file-table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

#file-table th {
    background-color: var(--hover-bg-color);
}

#file-table tbody tr:hover {
    background-color: #f1f1f1;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Multi-select and batch actions */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.batch-delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.batch-delete-btn:hover {
    background-color: #c82333;
}

.batch-delete-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#selected-count {
    color: var(--primary-color);
    font-weight: bold;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.file-checkbox {
    margin: 0;
}

#file-table tbody tr.selected {
    background-color: #e3f2fd;
}

#file-table tbody tr.selected:hover {
    background-color: #bbdefb;
}
